<script src="${rc.getContextPath()}/manage/js/dwzCustomJs/dwz.custom.advancedquery.js?v=${ver}" type="text/javascript"></script>
<#include "/common/pagerForm.html">
<form rel="pagerForm" method="post" action="" onsubmit="return navTabSearch(this)">
<div class="pageHeader">
    <div class="searchBar">
        <ul class="searchContent">
            <li ><label><@label key='productionOrderNum.C,colon'>订单编号：</@label></label> <input type="text" name="productionOrderNum" value="${condition.productionOrderNum!''}"/></li>
            <li ><label><@label key='plannedStartDate.C'>计划日期从：</@label></label>
            <input type="text" class="textInput date required valid"   name="plannedStartDate" readonly max_date="{plannedEndDate}" value="${condition.plannedStartDate!''}"/><a class="inputDateButton" href="javascript:;">选择</a>
            <li ><label><@label key="to.C,colon">至：</@label></label>
            <input type="text" class="textInput date required valid"  name="plannedEndDate" readonly min_date="{plannedStartDate}" value="${condition.plannedEndDate!''}"/><a class="inputDateButton" href="javascript:;">选择</a></li>
        </ul>
        <ul class="searchContent">
            <li ><label><@label key='orderType.C,colon'>订单类型：</@label></label> 
                <select name="orderTypeCode">
                    <option value="" ><@label key='all.C'>所有</@label></option>
                    <#if orderTypeList??>
                        <#list orderTypeList as orderType>
                            <option value="${orderType.orderTypeCode!''}" <#if condition.orderTypeCode?? && condition.orderTypeCode == orderType.orderTypeCode> selected</#if> >${orderType.orderTypeText!''}</option>
                        </#list>
                    </#if>
                </select>
            </li>
            <li ><label><@label key='requirementStartDate.C,colon'>需求日期从：</@label></label>
            <input type="text" class="date"   name="requirementStartDate" readonly max_date="{requirementEndDate}" value="${condition.requirementStartDate!''}"/><a class="inputDateButton" href="javascript:;">选择</a>
            <li ><label><@label key="to.C,colon">至：</@label></label>
            <input type="text" class="date"  name="requirementEndDate" readonly min_date="{requirementStartDate}" value="${condition.requirementEndDate!''}"/><a class="inputDateButton" href="javascript:;">选择</a></li>
            <li class="query">
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit" name="btnQuery"><@label key="query.B">查询</@label></button>
                    </div>
                </div>
            </li>
        </ul>
        <ul class="searchContent">
           <li ><label><@label key='workCenter.C,colon'>工作中心：</@label></label> 
                <select name="workCenterCode">
                    <option value="" ><@label key='all.C'>所有</@label></option>
                    <#if workCenterList??>
                        <#list workCenterList as workCenter>
                            <option value="${workCenter.workCenterCode!''}" <#if condition.workCenterCode?? && condition.workCenterCode == workCenter.workCenterCode> selected</#if> >${workCenter.workCenterText!''}</option>
                        </#list>
                    </#if>
                </select>
            </li>
        </ul>
    </div>
</div>
</form>
<div class="pageContent">
    <div class="panelBar">
    	<ul class="toolBar">
            <@buttonRight menuCode="productionOrderPlan_view" labelKey="view.B" defalutName="详情">
            <li><a class="icon" target="dialog" mask="true" width="635" height="350"
            href="${rc.getContextPath()}/manage/productionOrderPlan/viewProductionOrderPlanWithExtInfo?id={productionOrderPlan_id}&navTabId=${navTabId!''}"><span><@label key="view.B">详情</@label></span></a></li></@buttonRight>
            <@buttonRight menuCode="productionOrderPlan_export" labelKey="exportToExcel.D" defalutName="全部导出">
            <li><a class="export" mask="true" target='dwzExport' title="<@label key='confirmexportToExcel.M'>确定要导出这些记录吗?</@label>"
            href="${rc.getContextPath()}/manage/productionOrderPlan/exportProductionOrderPlansWithExtInfoToExcel?navTabId=${navTabId!''}"><span><@label key="exportToExcel.D">全部导出</@label></span></a></li></@buttonRight>
        </ul>
    </div>
    <table class="table" width="160%" layoutH="190">
        <thead>
            <tr>
                <th width="40"><@label key="serialNumber.C">序号</@label></th>
                <!-- 
                <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                 -->
                <th width="80" orderField="workCenterText" <#if (page.orderField?? && page.orderField == 'workCenterText')>class="${page.orderDirection!''}"</#if>><@label key='workCenter.C'>工作中心</@label></th>
                <th width="80" orderField="statuseCode" <#if (page.orderField?? && page.orderField == 'statuseCode')>class="${page.orderDirection!''}"</#if>><@label key='orderStatusECode.C'>订单状态</@label></th>
                <th width="100" orderField="productionOrderNum" <#if (page.orderField?? && page.orderField == 'productionOrderNum')>class="${page.orderDirection!''}"</#if>><@label key='productionOrderNum.C'>生产订单编号</@label></th>
                <th width="100" orderField="materialCode" <#if (page.orderField?? && page.orderField == 'materialCode')>class="${page.orderDirection!''}"</#if>><@label key='materialCode.C'>物料编号</@label></th>
                <th width="100" orderField="materialText" <#if (page.orderField?? && page.orderField == 'materialText')>class="${page.orderDirection!''}"</#if>><@label key='materialText.C'>物料名称</@label></th>
                <th width="80" orderField="plannedQuantity" <#if (page.orderField?? && page.orderField == 'plannedQuantity')>class="${page.orderDirection!''}"</#if>><@label key='plannedQuantity.C'>计划数量</@label></th>
                <th width="80" orderField="plannedStartDate" <#if (page.orderField?? && page.orderField == 'plannedStartDate')>class="${page.orderDirection!''}"</#if>><@label key='plannedDate.C'>计划日期</@label></th>
                <th width="100" orderField="requirementDate" <#if (page.orderField?? && page.orderField == 'requirementDate')>class="${page.orderDirection!''}"</#if>><@label key='requirementDate.C'>需求日期</@label></th>
                <th width="80" orderField="productionLotNum" <#if (page.orderField?? && page.orderField == 'productionLotNum')>class="${page.orderDirection!''}"</#if>><@label key='productionlotNum.C'>生产批次号</@label></th>
                <th width="140" orderField="plannedstartDateTime" <#if (page.orderField?? && page.orderField == 'plannedstartDateTime')>class="${page.orderDirection!''}"</#if>><@label key='plannedstartDateTime.C'>计划开始时间</@label></th>
                <th width="140" orderField="plannedendDateTime" <#if (page.orderField?? && page.orderField == 'plannedendDateTime')>class="${page.orderDirection!''}"</#if>><@label key='plannedendDateTime.C'>计划结束时间</@label></th>
            </tr>
        </thead>
        <tbody>
        <#if page??><#if (page.data?size>0)> <#list page.data as productionOrderPlan>
            <tr target="productionOrderPlan_id" rel="${productionOrderPlan.id!''}">
                <td>${page.startRow + productionOrderPlan_index}</td>
                <!-- 
                <td><input name="ids" value="${productionOrderPlan.productionOrderNum!''}" type="checkbox"></td>
                 -->
                <td>${productionOrderPlan.workCenterText!''}</td>
                <td>
                <#if productionOrderPlan.statuseCode??>
                    ${productionOrderTypeEcodeMap[productionOrderPlan.statuseCode].eCodeText}
                </#if>
                </td>
                <td>${productionOrderPlan.productionOrderNum!''}</td>
                <td>${productionOrderPlan.materialCode!''}</td>
                <td>${productionOrderPlan.materialText!''}</td>
                <td>${productionOrderPlan.plannedQuantity!''}</td>
                <td>${(productionOrderPlan.plannedStartDate?string("yyyy-MM-dd"))?if_exists}</td>
                <td>${(productionOrderPlan.requirementDate?string("yyyy-MM-dd"))?if_exists}</td>
                <td>${productionOrderPlan.productionLotNum!''}</td>
                <td>${(productionOrderPlan.plannedstartDateTime?string("yyyy-MM-dd HH:mm:ss"))?if_exists}</td>
                <td>${(productionOrderPlan.plannedendDateTime?string("yyyy-MM-dd HH:mm:ss"))?if_exists}</td>
            </tr>
        </#list>
        <#else>
        <tr target="productionOrderPlan_id">
                <td colspan="20" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
        </tr>
        </#if>
        <#else>
        <tr target="productionOrderPlan_id">
                <td colspan="20" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
        </tr>
        </#if>
        </tbody>
    </table>
    <#include "/common/panelBar.html">
</div>
<script type="text/javascript">
(function($){
	var page = DWZ.context();
	$("button[name='btnQuery']",page).on('click',function(){
		var plannedStartDate = $("input[name='plannedStartDate'][type='text']",page).val();
		var plannedEndDate = $("input[name='plannedEndDate'][type='text']",page).val();
		
		if(""===plannedEndDate || ""===plannedStartDate){
			alertMsg.error("计划日期不能为空！");
			return false;
		}
		$("input[name='pageNum']",page).val("1");
	})
})(jQuery);
</script>